﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Urb.Weather.Core.Provider;

namespace Urb.Weather.Engine
{
    internal class WeatherDataProviderInstanceRegistrationToken : IWeatherDataProviderInstanceRegistrationToken
    {
        private uint uniqueNumber = 0;

        public WeatherDataProviderInstanceRegistrationToken(uint uniqueNumber)
        {
            this.uniqueNumber = uniqueNumber;
        }

        public int CompareTo(IWeatherDataProviderInstanceRegistrationToken other)
        {
            if (this == null)
            {
                if (other != null)
                    return -1;

                return 0;
            }

            if (other == null)
                return 1;

            if (other is WeatherDataProviderInstanceRegistrationToken)
                return uniqueNumber.CompareTo(((WeatherDataProviderInstanceRegistrationToken)other).uniqueNumber);

            return 1;
        }
    }
}
